package com.krediti.session;

import java.util.Arrays;
import java.util.List;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;

import com.krediti.entity.Namena;

@Name("namenaList")
public class NamenaList extends EntityQuery<Namena> {

	/**
	 * Generated serial version.
	 */
	private static final long serialVersionUID = 898459964721081047L;

	private static final String[] RESTRICTIONS = { "lower(namena.naziv) like concat(lower(#{namenaList.namena.naziv}),'%')", };

	private Namena namena = new Namena();

	@Override
	public String getEjbql() {
		return "select namena from Namena namena";
	}

	@Override
	public Integer getMaxResults() {
		return 25;
	}

	public Namena getNamena() {
		return namena;
	}

	@Override
	public List<String> getRestrictions() {
		return Arrays.asList(RESTRICTIONS);
	}

}
